/*
    This file is part of Emu.

    Emu is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Emu is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Emu.  If not, see <http://www.gnu.org/licenses/>. */
#ifndef ETRIGGER_H
# define ETRIGGER_H

# include <QColor>
# include <QRegExp>

/* Bitflags for trigger options.
   KeepGoing : If matched, continue trigger matching.
   Highlight : If matched, highlight the text. Can't be used with delete.
   Omit      : If matched, omit the text. Can't be used with delete.
   HasReply  : (Internal) Set if the trigger returns text.
   Capturing : (Internal) Set if the trigger uses a regexp and the reply
               quotes the sent data. */
# define TRIG_KEEPGOING 0x01
# define TRIG_HIGHLIGHT 0x02
# define TRIG_OMIT      0x04
# define TRIG_HASREPLY  0x10
# define TRIG_CAPTURING 0x20

class ETrigger : public QRegExp
{
public:
    ETrigger();

    int options() const { return _options; }
    QColor highlightColor() const { return _highlightColor; }
    QString output() const { return _output; }
    QString name() const { return _name; }

    void setHighlightColor(QColor c) { _highlightColor = c; }
    void setName(QString n) { _name = n; }
    void setOptions(int o) { _options = o; }
    void setOutput(QString);

private:
    int _options;
    QColor _highlightColor;
    QString _name;
    QString _output;
};

#endif
